package lab01;

/**
 * Created by Administrator on 2017/10/8.
 */
public class Test11 {
    public static void main(String[] args) {
        int a;
        int count = 0;
        for(a=2; a<=100;a++){
            if(isPrimeNumber(a) == true){
                 count++;
                  System.out.printf("%6d",a);
                  if(count%5 == 0)
                      System.out.println();
            }
        }
    }
    public static boolean isPrimeNumber(int num){
          int k = (int) Math.sqrt(num);
          if(num == 2)
              return true;
          for(int a=2; a<=k; a++)
              if(num%a == 0)
                 return false;
         return true;
      }
   }
